package com.example.peibei.ui.adapter;

import android.graphics.Color;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.example.peibei.R;
import com.example.peibei.bean.CityList;

import java.util.List;

public class CityListAdapter extends BaseQuickAdapter<CityList, BaseViewHolder> {
    public CityListAdapter() {
        this(null);
    }

    public CityListAdapter(@Nullable List<CityList> data) {
        super(R.layout.item_citylist, data);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder baseViewHolder, CityList cityList) {
        if ("全部".equals(cityList.getAreaName())){
            baseViewHolder.setTextColor(R.id.tv_name, Color.parseColor("#ED2D34"));
        }else {
            baseViewHolder.setTextColor(R.id.tv_name, Color.parseColor("#B3000000"));
        }
        baseViewHolder.setText(R.id.tv_name,cityList.getAreaName());
    }
}
